<%-- 
    Document   : checkgrammarseman
    Created on : 11/Abr/2010, 6:50:58
    Author     : luis
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"
    import="pt.our.angemc.parser.*"
    import="org.json.*"
    import="java.util.Set"
%>

<%
    String text = request.getParameter("text");
    Parser2 p = new Parser2();
    Set<String> res = p.checkGrammarSeman(text);

    JSONObject obj = new JSONObject();
    if(!res.isEmpty())
    {
        obj.put("success", false);
        obj.put("errors", res);
    }
    else
    {
        obj.put("success", true);
    }

    out.print(obj);
%>
